package com.black.opsapi.feign.factory;

import com.black.opsapi.feign.RemoteRoleService;
import com.black.opsapi.feign.fallback.RemoteRoleServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author qiang.zhang
 * @date 2019/2/1
 */
@Component
public class RemoteRoleServiceFallbackFactory implements FallbackFactory<RemoteRoleService> {

	@Override
	public RemoteRoleService create(Throwable throwable) {
		RemoteRoleServiceFallbackImpl remoteRoleServiceFallback = new RemoteRoleServiceFallbackImpl();
		remoteRoleServiceFallback.setCause(throwable);
		return remoteRoleServiceFallback;
	}
}
